package com.prs.crm.dao.oa.impl;

import java.sql.SQLException;
import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.springframework.orm.hibernate3.HibernateCallback;

import com.prs.crm.dao.impl.BaseDaoImpl;
import com.prs.crm.dao.oa.ReadyWritePermissionSetDao;
import com.prs.crm.domain.oa.ReadyWritePermissionSet;

public class ReadyWritePermissionSetDaoImpl extends BaseDaoImpl<ReadyWritePermissionSet> implements ReadyWritePermissionSetDao{

	@SuppressWarnings("unchecked")
	@Override
	public List<ReadyWritePermissionSet> getAllReadyWritePermission() {
		return (List<ReadyWritePermissionSet>) this.getHibernateTemplate().execute(new HibernateCallback() {
			public Object doInHibernate(Session session)
					throws HibernateException, SQLException {
				Criteria criteria=session.createCriteria(ReadyWritePermissionSet.class);
				return criteria.list();
			}
		});
	}
}
